﻿		<table>
		<thead>
			<tr>
				<th scope="col">Kod</th>
				<th scope="col">Namn</th>
				<th scope="col">Sp</th>
				<?php if (array_key_exists('years',$results[0])) { ?>
				<th scope="col">År</th>
				<th scope="col">Version</th>
				<?php } ?>
				<th scope="col">Typ</th>
				<th scope="col">Lägg till <br />kurs</th>
			</tr>
		</thead>
		<tbody>
<?php $count = 0;
foreach ($results as $result) { ?>

<?php if (strlen($result['name']) > 0) { ?>
			<tr>
				<td><?php echo $result['code']; ?></td>
				<td><?php echo $result['name']; ?></td>
				<td><?php echo $result['sp']; ?></td>
				<?php if (array_key_exists('years',$results[0])) { ?>
				<td><?php echo $result['years']; ?></td>
				<td><?php echo $result['version']; ?></td>
				<?php } ?>
				<td><?php echo $result['type']; ?></td>
				<td><?php
				echo "<a href=\"?action=addExam&row=$count\">[Lägg till]</a>";
				?></td>

			<tr>
<?php } 
	$count++; ?>
<?php } ?>
		</tbody>
		</table>
